import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router);
//首页功能路由文件
import IndexFun from '@/router/indexFun'
//发现页面功能的路由
import FindFun from '@/router/findFun'
//消息页面功能的路由
import NewsFun from '@/router/newsFun'
//我的页面功能的路由
import MyFun from '@/router/myFun'


export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      name: 'index',
      component: resolve => require(['@/components/index'], resolve)
    }, {
      path: '/find',
      name: 'find',
      component: resolve => require(['@/components/find'], resolve)
    },
    {
      path: '/news',
      name: 'zone',
      component: resolve => require(['@/components/news'], resolve)
    }, {
      path: '/my',
      name: 'my',
      component: resolve => require(['@/components/my'], resolve)
    }, , {
      path: '/login',
      name: 'login',
      component: resolve => require(['@/components/common/login'], resolve)
    },
    ...IndexFun,
    ...FindFun,
    ...NewsFun,
    ...MyFun,
    {
      path: '*',
      name: 'notFound',
      component: resolve => require(['@/components/common/error'], resolve)
    }
  ]
})
